<?php 
/*-- Project Introduce --*/


class JCAT_JPDRScreen extends JCAT_JPDRCommander 
{	
	/**
	 * Description
	 *
	 * @access	public
	 * @return	void
	 */
	public function JCAT_JPDRScreen()
	{
		try{
			$this->JCAT_JPDRCommander(new COM("JPDRWinCmd.Scr")) ;
		}
		catch (Exception $e)
		{
			throw new JCAT_Exception( JCAT::CharsetToProject($e->getMessage())) ;
		}
	}
	
	
	/**
	 * 取得屏幕上某个坐标位置的当前颜色值
	 *
	 * @access	public
	 * @param	$nX		int
	 * @param	$nY		int
	 * @return	string
	 */
	public function GetPixel($nX,$nY)
	{
		$this->CheckAvailable() ;
		
		$sColor = '' ;
		$this->GetCOM()->GetPixel(0,$nX,$nY,$sColor) ;
		return $sColor ;
	}
	
	/**
	 * 取得指定窗口上某个坐标位置的当前颜色值
	 *
	 * @access	public
	 * @param	$nWnd					int
	 * @param	$nX						int
	 * @param	$nY						int
	 * @return	string
	 */
	public function GetWindowPixel($nWnd,$nX,$nY)
	{
		$this->CheckAvailable() ;
		
		$sColor = '' ;
		$this->GetCOM()->GetPixel(intval($nWnd),$nX,$nY,$sColor) ;
		return $sColor? $sColor : null ;
	}
	
}
?>